<%@page import="java.util.Arrays"%>
<%@page import="org.ifilm.model.Project"%>
<%@page import="java.util.List"%>
<%@page import="org.ifilm.controller.ProjectController"%>
<%@page import="org.ifilm.util.GeneralConstants"%>

<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Edit Postings</title>
	
	<link rel="icon" type="image/png" href="/film/img/favicon.ico">
	<link href="/film/css/index.css" rel="stylesheet" />
	<link href="/film/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
	
	<script src="/film/js/jquery.js"></script>
	<script src="/film/bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="/film/js/jquery.validator.js"></script>
	<script src="/film/js/photoUpload.js"></script>
	
	<style>
		body {
			padding-top: 60px;
			/* 60px to make the container go all the way to the bottom of the topbar */
						
		}	
		
		.long-text {
				width : 400px;
			}	
	</style>
</head>
<body>
	<jsp:include page="navigationBar.jsp"/>		
	<div class="container">
	<form method="POST" action="/film/notice/savePostingEdit.do?postingId=${posting.id}">
	<table class="table table-condensed" width=100%>
		<tr>
			<td width=45%><h4>${posting.type} for my project <a href="/film/project/getProject.do?pid=${posting.project.id}">${posting.project.projectName}</a></h4></td>
			<td colspan=2></td>
		</tr>
		<c:set var="frontCam" value="${posting.type == 'actor' or posting.type == 'actress' or posting.type == 'dublour'}"/>
			<c:if test="${frontCam == true}">				
				<tr>
					<td width=45%>Role Description:</td>
										
					<td colspan=2>
						<textarea rows="5" class="inp long-text" placeholder="${posting.description}"
						name="<%=GeneralConstants.editPostingDescription%>"></textarea>												
					</td>
				</tr>
	 			<tr>
					<td width=45%>Height:</td>
					<td>
						<input class="inp number" type="number" step="1" max=250 min=1 value="${posting.minHeight}" name="<%=GeneralConstants.editPostingMinHeight%>">
					</td>
					<td>
						- <input class="inp number" type="number" step="1" max=250 min=1 value="${posting.maxHeight}" name="<%=GeneralConstants.editPostingMaxHeight%>"> cm
 					</td>
				</tr>
				<tr>
					<td width=45%>Weight:</td>
					<td>
						<input class="inp number" type="number" step="1" max=250 min=1 value="${posting.minWeight}" name="<%=GeneralConstants.editPostingMinWeight%>">
					</td>
					<td>
						- <input class="inp number" type="number" step="1" max=250 min=1 value="${posting.maxWeight}" name="<%=GeneralConstants.editPostingMaxWeight%>"> kg
 					</td>
				</tr>
				<tr>
					<td width=45%>Age:</td>
					<td>
						<input class="inp number" type="number" step="1" max=100 min=1 value="${posting.minAge}" name="<%=GeneralConstants.editPostingMinAge%>">
					</td>
					<td>
						- <input class="inp number" type="number" step="1" max=100 min=1 value="${posting.maxAge}" name="<%=GeneralConstants.editPostingMaxAge%>">
 					</td>
				</tr>
				<tr>
					<td width=45%>Hair Color:</td>
					<td>
						<select class="inp" title="hair"  name="<%=GeneralConstants.editPostingHair%>">
							<option value="${posting.hairColor}">${posting.hairColor}</option>
							<option value="any">any</option>
							<option value="blond">Blond</option>
							<option value="red">Red</option>
							<option value="auburn">Auburn</option>
							<option value="chestnut">Chestnut</option>									
							<option value="brown">Brown</option>
							<option value="black">Black</option>
							<option value="gray">Gray</option>
						</select>
					</td>
					<td></td>
				</tr>
				<tr>
					<td width=45%>Eye Color:</td>
					<td>
						<select class="inp" title="eye" name="<%=GeneralConstants.editPostingEye%>">
							<option value="${posting.eyeColor}">${posting.eyeColor}</option>
							<option value="any">any</option>
							<option value="green">Green</option>
							<option value="hazel">Hazel</option>
							<option value="brown">Brown</option>
							<option value="black">Black</option>
							<option value="violet">Violet</option>
							<option value="gray">Gray</option>
						</select>
					</td>	
					<td></td>			
				</tr>
				<tr>
					<td width=45%>Additional Physical Description:</td>					
					<td colspan=2>
						<textarea rows="5"  class="inp long-text" placeholder="${posting.physicalDescription}"
						name="<%=GeneralConstants.editPostingPhysicalDescription%>"></textarea>
						
					</td>
				</tr>
				<tr>
					<td width=45%>Qualifications:</td>
					<td colspan=2>
						<textarea rows="5"  class="inp long-text" placeholder="${posting.qualifications}"
						name="<%=GeneralConstants.editPostingQualifications%>"></textarea>						
					</td>
				</tr>
	 		</c:if>
	 		<c:if test="${frontCam == false }">
	 			<tr>
					<td width=45%>Job Description:</td>					
					<td colspan=2>
						<textarea rows="5" width="100%" class="inp long-text" placeholder="${posting.description}"
						name="<%=GeneralConstants.editPostingDescription%>"></textarea>
												
					</td>
				</tr>
	 			<tr>
					<td width=45%>Qualifications:</td>					
					<td colspan=2>
						<textarea rows="5" width="100%" class="inp long-text" placeholder="${posting.qualifications}"
						name="<%=GeneralConstants.editPostingQualifications%>"></textarea>						
					</td>
				</tr>
			</c:if>
			<tr>
				<td>
					<button class="btn btn-large btn-primary" type="submit">Submit</button>
				</td>
				<td>
				</td>
				<td>
				</td>
			</tr>
		</table>
		</form>
	</div>
</body>
</html>